package com.company.test30.CharSoftware;

/**
 * Created by v on 16-12-6.
 */
public class ClearMessage implements Runnable {
    ChatPanel chatPanel;

    public ClearMessage(ChatPanel chatPanel){
        this.chatPanel=chatPanel;
    }

    @Override
    public void run() {
        //先让线程沉睡一小段时间，让出给JTextArea输入的机会
        try {
            Thread.sleep(2);
        }catch (InterruptedException ex){
            ex.printStackTrace();
        }
        chatPanel.jtaInput.setText("");
    }
}
